package org.ielts.domain.report;

import java.text.NumberFormat;

import org.ielts.domain.security.User;

public class ConsultantSignedReport {

	public User user;

	public long assigned;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public long getAssigned() {
		return assigned;
	}

	public void setAssigned(long assigned) {
		this.assigned = assigned;
	}

	public long getSigned() {
		return signed;
	}

	public void setSigned(long signed) {
		this.signed = signed;
	}

	public long signed;

	public String getRate() {
		if (assigned == 0) {
			return "0";
		}

		double d = (double) signed / assigned;

		NumberFormat defaultFormat = NumberFormat.getPercentInstance();
		defaultFormat.setMinimumFractionDigits(2);

		return defaultFormat.format(d);
	}
}
